var app = new Vue({
	el: "#container",
	data: {
		tlist: SelectIssueAndCompanyByID()
	},
	methods: {
		getImgUrl(imgname) {
			var url = 'http://101.37.77.75:8080/lagouwangImg/img/' + imgname + '.jpg'
			return url
		},
		toudi(id, companyid, companyname, name, userid) {
			var resumeid
			var URL
			$.ajax({
				url: "http://101.37.77.75:8080/lagouwang/ResumeServlet?t=getResumeByUserid",
				async: false,
				type: 'post',
				dataType: "json",
				xhrFields: {
					withCredentials: true
				},
				success: function(data) {
					if(data.status == 1) {
						resumeid = data.data[0].id
					}
				}
			})

			$.ajax({
				url: "http://101.37.77.75:8080/lagouwang/GetResumeServlet?type=addGetResume",
				async: false,
				type: 'post',
				dataType: "json",
				xhrFields: {
					withCredentials: true
				},
				data: {
					"companyid": companyid,
					"positionid": id,
					"resumeid": resumeid,
					"companyname": companyname,
					"positionname": name,
					"userid": userid
				},
				success: function(data) {
					if(data.status == 1) {
						alert(data.msg)
						location.href="delivery.html"
					} else {
						alert(data.msg)
					}
				}
			})
		}
	}
})

function tuodidata(id, companyid, companyname, name, userid){
	alert(id)
	alert(companyid)
}

function SelectIssueAndCompanyByID() {
	var id = location.href.split('?')[1].split('=')[1]
	var jlist
	$.ajax({
		url: "http://101.37.77.75:8080/lagouwang/lssueServlet?type=SelectIssueAndCompanyByID",
		async: false,
		dataType: "json",
		data: {
			"id": id
		},
		success: function(data) {
			jlist = data.data
		}
	})
	return jlist
}
